<div class="content-box"><!-- Start Content Box -->
    <div class="content-box-header">
        
        <h3>Thêm mới sản phẩm</h3>
        
        <ul class="content-box-tabs">
       
            <li><a href="#">Table</a></li> <!-- href must be unique and match the id of target div -->
            <li><a href="#tab2" class="default-tab">Forms</a></li>
        </ul>
        
        <div class="clear"></div>
        
    </div> <!-- End .content-box-header -->
    
    <div class="content-box-content">
	<div class="content-box-tabs" id="tab2">    
	
   	<!-- <h1>Edit: </h1>-->
    <form action="" method="post"> 
        Enter your Image: <input type="text" name="txtnum" value="<?php echo $_POST['txtnum']; ?>" size="10" /> 
        <input type="submit" name="ok_num" value="Accept" /> 
    </form>
	<?php 
		if(isset($_POST['ok_num'])) 
		{ 
		 $num=$_POST['txtnum']; 
		 echo "<hr />"; 
		 echo "Ban dang chon $num file upload<br />"; 
		 echo "<form action='' method='post' enctype='multipart/form-data'>"; 
		 for($i=1; $i <= $num; $i++) 
		 { 
		 echo "<input type='file' name='img[]' /><br />"; 
		 } 
		 echo "<input type='submit' name='ok_upload' value='Upload' />"; 
		 echo "</form>"; 
		} 
	?> 
	<?php 
    //$site= "http://www.sotayweb.com"; 
    if(isset($_POST['ok_upload'])) 
    { 
     //$num=$_GET['file']; 
     echo "<h3>Demo Images Script - SotayWeb.com</h3>"; 
     
     for($i=0; $i< $num; $i++) 
     { 
     move_uploaded_file($_FILES['img']['tmp_name'][$i],"../uploads/".$_FILES['img']['name'][$i]); 
     $url="../uploads/".$_FILES['img']['name'][$i]; 
     $name=$_FILES['img']['name'][$i]; 
     echo $sql="insert into tbl_sanpham_hinhanh(masp,img_url,img_name) values('$masp','$url','$name')"; 
     mysql_query($sql);
     echo "Upload Thanh cong file <b>$name</b><br />"; 
    
     
     } 
     
    } 
    else 
    {  echo "Vui long chon hinh truoc khi truy cap vao trang nay";
    }
    ?>
			</div> <!-- End #tab2 -->
      	<div class="tab-content" id="tab1"> <!-- This is the target div. id must match the href of this div's tab -->
        </div> <!-- End #tab1 -->
    </div> <!-- End .content-box-content -->
</div> <!-- End .content-box -->